Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow check_graphic to be more flexible #4370

Merged
merged 2 commits into from
Oct 13, 2021
Merged

Conversation

jamesp
Copy link
Member

@jamesp jamesp commented Oct 13, 2021

🚀 Pull Request

I'm not convinced this is the right way to do this so feedback welcome.

Description

This change allows check_graphic to be more lenient when passed a key that is not fully qualified.

This is to support the VSCode test runner.

imagerepo.json contains fully qualified names, such as iris.tests.test_quickplot.TestLabels.test_contour.0, but when running a specific test from the VSCode GUI, it fails with this error: ./test_quickplot.py::TestLabels::test_contour Failed: Missing image test result: test_quickplot.TestLabels.test_contour.0. The way the VSCode test runner loads and runs the unittest it does not fully qualify the package.

If an exact match in the imagerepo is not found, a test will fail. This PR will check for partially qualified test image targets. If exactly one match is found in the imagerepo, it will use that and continue. If not, the original logic applies as before this PR.


Consult Iris pull request check list

jamesp and others added 2 commits October 13, 2021 13:00
This change allows check_graphic to be more flexible when
passed a key that is not fully qualified.
Copy link
Member

@bjlittle bjlittle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jamesp Looks good to me.

There's no harm in being a little bit graceful here when it comes to matching, nice one 👍

Once the CI is happy, then so am I 😄

If you fancy adding a whatsnew entry, that would be cool. However, if you don't want to shout about infrastructure changes, than that's cool too.

@bjlittle bjlittle merged commit 9844580 into SciTools:main Oct 13, 2021
tkknight added a commit to tkknight/iris that referenced this pull request Nov 3, 2021
* main: (44 commits)
  [pre-commit.ci] pre-commit autoupdate (SciTools#4395)
  min pin for numpy (nep29) (SciTools#4386)
  Updated environment lockfiles (SciTools#4393)
  Extend stock.mesh api (SciTools#4389)
  Updated environment lockfiles (SciTools#4388)
  Integrate ASV with Nox (SciTools#4378)
  NetCDF save - stream ALL lazy arrays. (SciTools#4375)
  adopt flake8 maccabe complexity metric (SciTools#4380)
  Accept inverse_flattening = 0 for spherical ellipsoid (closes SciTools#4146) (SciTools#4368)
  Updated environment lockfiles (SciTools#4379)
  Prevent warning in `test_Saver` (SciTools#4376)
  drop pyugrid in site.cfg (SciTools#4373)
  `flake8` dependency (SciTools#4371)
  update latest whosnew (SciTools#4372)
  Allow `check_graphic` to be more flexible (SciTools#4370)
  [pre-commit.ci] pre-commit autoupdate (SciTools#4365)
  Updated environment lockfiles (SciTools#4364)
  Update latest.rst (SciTools#4362)
  More clarity on setting `iris-test-data` location. (SciTools#4359)
  update whatsnew (SciTools#4361)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants